package com.example.saiweisi.service.impl.sysTemAdminService;

import com.example.saiweisi.controller.request.PageBaseRequest;
import com.example.saiweisi.mapper.systemAdminMapper.WashKindMapper;
import com.example.saiweisi.model.WashKind;
import com.example.saiweisi.service.interf.IWashKindService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WashKindService implements IWashKindService {
    @Autowired
    WashKindMapper washKindMapper;
    @Override
    public PageInfo<WashKind> page(PageBaseRequest pageBaseRequest) {
        PageHelper.startPage(pageBaseRequest.getPageNum(), pageBaseRequest.getPageSize());
        List<WashKind> userList = washKindMapper.washkindlistByCondition(pageBaseRequest);
        return new PageInfo<>(userList);
    }

    @Override
    public void addwashkind(WashKind washKind) {
        washKindMapper.addwashkind(washKind);
    }

    @Override
    public void deletewashkind(Integer washKindId) {
        washKindMapper.deletewashkind(washKindId);
    }

    @Override
    public WashKind getById(Integer washKindId) {
        return washKindMapper.getById(washKindId);
    }

    @Override
    public void updatewashkind(WashKind washKind) {
        washKindMapper.updatewashkind(washKind);
    }

    @Override
    public List<WashKind> getAllWashKind() {

        return washKindMapper.getAllWashKind();
    }
}
